class Solution {
public:
    int missingNumber(vector<int>& nums) {
        int sum = 0;
        for (auto e : nums) sum ^= e;
        for (int i = 0; i <= nums.size(); i++) sum ^= i;
        return sum;

    }
};
class Solution {
public:
    int getSum(int a, int b) {
        while (b != 0)
        {
            int x = a ^ b;
            unsigned int carry = (a & b) << 1;
            a = x;
            b = carry;
        }
        return a;

    }
};